<?php
interface ICache {
	/**
	 * 
	 * @param string $key
	 * @param mixed $var
	 * @param int $flag Use MEMCACHE_COMPRESSED to store the item compressed (uses zlib). 
	 * @param int $expire
	 * @return bool
	 */
	public function add($key, $var, $flag = 0, $expire = 0);
	
	/**
	 * 
	 * @param string $host
	 * @param int $port
	 * @return bool
	 */
	public function addServer($host, $port = 11211);
	
	/**
	 * @return bool
	 */
	public function close();
	
	/**
	 * 
	 * @param string $host
	 * @param int $port
	 * @return bool
	 */
	public function connect($host, $port = 11211);
	
	/**
	 * 
	 * @param string $key
	 * @param int $timeout
	 * @return bool
	 */
	public function delete($key, $timeout = 0);
	
	/**
	 * @return bool
	 */
	public function flush();
	
	/**
	 * 
	 * @param string|array $key
	 * @param int|array $flag
	 * @return string
	 */
	public function get($key, $flag = 0);
	
	/**
	 * @return string
	 */
	public function getVersion();
	
	/**
	 * 
	 * @param string $key
	 * @param mixed $var
	 * @param int $flag Use MEMCACHE_COMPRESSED to store the item compressed (uses zlib). 
	 * @param int $expire
	 * @return bool
	 */
	public function set($key, $var, $flag = 0, $expire = 0);

}